package com.springboot.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.springboot.pojo.TeacherCity;
import com.springboot.pojo.TeacherPro;
import org.apache.ibatis.annotations.*;
import org.mybatis.spring.annotation.MapperScan;

import java.util.List;

@Mapper
public interface TeacherProMapper extends BaseMapper<TeacherPro> {


    @Select(" select * from tea_pro p where p.id=#{id} ")
    @Results({
            @Result(id = true,column = "id",property = "id"),
            @Result(column = "provincial",property = "provincial"),
            @Result(
                    property = "teacherCity",
                    column = "id",
                    javaType = List.class,
                    many = @Many(select = "com.springboot.mapper.TeacherCityMapper.findById")
            )
    })
    TeacherPro getTeacherPro(Integer id);


}
